/*******************************************OVERVIEW*******************************************************
 
Suffrage Reform and Financial Volatility
 
Replication file
 
Figure 1: Q-Q (quantile-quantile) Plots
 
Version March 14 2022 
 
  
********************************************************************************************************************/

clear
set more off
#delimit ;


/*Set Directory -- You will need to adjust this line of code accordingly */; 


cd "/Users/ssaiegh/Files/Mac/JHPE";

/*Create Log File*/;

log using "Figure 1", replace text;


/*Load Data File*/;

use "cs_jhpe.dta";


/*Estimate VAR Model */; 


qui: var ret_cons ret_pound ret_bankindia ret_train_un ret_bank_un ret_dutch rentes_tot, lags(1/6) dfk;


/*Calculate Scaled Residuals*/; 

predict res_c, res equation(ret_cons);
predict res_pound, res equation(ret_pound);
predict res_stock, res equation(ret_bankindia);
predict res_train, res equation(ret_train_un);
predict res_bank, res equation(ret_bank_un);
predict res_fra, res equation(rentes_tot);
predict res_dutch, res equation(ret_dutch);

gen consol_res_scaled=res_c/.0116868;
gen pound_res_scaled=res_pound/.0080463;
gen stock_res_scaled=res_stock/.013172;
gen train_res_scaled=res_train/.0296327;
gen bank_res_scaled=res_bank/.05641;
gen rentes_res_scaled=res_fra/.020034;
gen dutch_res_scaled=res_dutch/.0239048;

/*Produce Figure 1*/;

generate res_c_no = consol_res_scaled if crisis==0;
generate res_c_yes = consol_res_scaled if crisis==1;
qqplot  res_c_yes res_c_no;

generate res_fra_no = rentes_res_scaled if crisis==0;
generate res_fra_yes = rentes_res_scaled if crisis==1;
qqplot  res_fra_yes res_fra_no;



log c;
